package properties_gin

import "MoSkeleton/framework/core/consts"

type AuthGroupProperty struct {
	Jwt    JwtProperty    `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
	Oauth2 Oauth2Property `mapstructure:"oauth2" json:"oauth2" yaml:"oauth2"`
	Bearer JwtProperty    `mapstructure:"bearer" json:"bearer" yaml:"bearer"`
	//public-urls
	PublicUrls []string `mapstructure:"public-urls" json:"public-urls" yaml:"public-urls"`
}

type AuthBaseProperty struct {
	HeaderKey string `mapstructure:"header-key" json:"header-key" yaml:"header-key"`
	//no-force-auth-urls
	NoForceAuthUrls []string `mapstructure:"no-force-auth-urls" json:"no-force-auth-urls" yaml:"no-force-auth-urls"`
}

func (a *AuthBaseProperty) getHeaderKey() string {
	if a.HeaderKey == "" {
		return consts.DefaultAuth_Jwt_HeaderKey
	}
	return a.HeaderKey
}
